﻿using System;
using NUnit.Extensions.Forms;
using NUnit.Framework;

namespace NetworkFileShare.Test.EndToEnd {

    class MainClientFormDriver {

        AssertProbe probe;
        MainClientForm form;

        public MainClientFormDriver(MainClientForm form, AssertProbe probe) {
            this.form = form;
            this.probe = probe;
        }

        public void ShowsIdleForm() {
            var formFinder = new FormFinder();
            formFinder.Find(form.ApplicationName);
        }

        public void ShowsConnectedStatus() {
            var connectedStatus = new LabelTester(form.ConnectionStatusName, form.ApplicationName);
            probe.AssertThat(() => connectedStatus.Text, Is.EqualTo(MainClientForm.SuccessfulConnectionText));
        }

    }

}